A5Storage::DataContainer::Open Method
IN THIS PAGE
Syntax
A5Storage::DataContainer::Open as A5Storage::CallResult (BYREF Container as A5Sorage::DataContainer, ConnectionStringIn as C [, Passphrase as C])
A5Storage::DataContainer::Open as A5Storage::CallResult (BYREF Container as A5Sorage::DataContainer, NameCache as A5Storage::NameCache, ConnectionStringIn as C [, Passphrase as C])
Arguments
- BYREF ContainerA5Sorage::DataContainer
- NameCacheA5Storage::NameCache
Defines a set of Storage container connection strings.
- ConnectionStringInCharacter
The connection string for the Storage container.
- PassphraseCharacter
A passphrase used to decrypt the connection string. Only required if the connection string is encrypted.
Returns
- ResultA5Storage::CallResult
Information about whether or not the operation succeed. Result.Success with be .T. if the operation succeeds, otherwise .F.
Description
Open a connection to a storage location.
Example: Connect to a Storage Container
dim CallResult as CallResult dim Container as A5Storage::DataContainer = null_value() CallResult = A5Storage::DataContainer::Open(Container, "Provider='Disk';Container='c:\A5Webroot';") if CallResult.Success ' etc end if
Example: Connect to Multiple Storage Containers
dim CallResult as CallResult dim Container as A5Storage::DataContainer = null_value() dim Storages as C = <<%txt% Storage1 Provider='Disk';Container='C:\A5WebRoot1'; Storage2 Provider='Disk';Container='C:\A5WebRoot2'; %txt% dim Cache as A5Storage::NameCache = new A5Storage::NameCache(Storages) CallResult = A5Storage::DataContainer::Open(Container, Cache, "::Name::MyConnectionString") if CallResult.Success 'etc end if
The connection string passed into the example does have to be a named connection. If you pass a named connection, you must also provide a cache to look it up in.